<include file="public@header" />
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>商户主营业务列表</a></li>
        <li><a href="{:url('AdminBusiness/add')}">添加商户主营业务</a></li>
    </ul>
    <form action="" method="post" class="js-ajax-form margin-top-20">
        
        <table  class="table table-hover table-bordered table-list" id="menus-table">
            <thead>
            <tr>
                <th width="80">ID</th>
                <th>名称</th>
                <th>缩略图</th>
                <th width="80">排序</th>
                <th>状态</th>
                <th width="210">操作</th>
            </tr>
            </thead>
            <tbody>
                <foreach name="list" item="vo">
                    <tr>
                        <td>{$vo.id}</td>
                        <td><b>{$vo.name}</b></td>
                        <td>
                            <img style="width: 80px;height: 80px;" src="{$vo.thumbnail}"/>
                        </td>
                        <td>{$vo.list_order}</td>
                        <td>
                            <switch name="vo.status">
                                <case value="0">
                                    <span class="label label-danger">未启用</span>
                                </case>
                                <case value="1">
                                    <span class="label label-success">正常 </span>
                                </case>
                            </switch>
                        </td>
                        <td>
                            <a class="btn btn-xs btn-primary" 
                               href="{:url('AdminBusiness/edit',['id'=>$vo['id']])}">修改</a>
                               <if condition="$vo.status eq 1">
                                    <a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('AdminBusiness/ban',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
                                    <else/>
                                    <a class="btn btn-xs btn-success js-ajax-dialog" href="{:url('AdminBusiness/cancelBan',array('id'=>$vo['id']))}">启用</a>
                               </if>
                               
                        </td>
                    </tr>
                </foreach>
            </tbody>
        </table>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
    $(document).ready(function() {
        Wind.css('treeTable');
        Wind.use('treeTable', function() {
            $("#menus-table").treeTable({
                indent : 20
            });
        });
    });
</script>
</body>
</html>